<template>
  <div id="app">
    <NavBar v-if="showNavBar" />
    <router-view :key="routerViewKey"></router-view>
  </div>
</template>

<script>
import NavBar from './components/NavBar.vue'
export default {
  name: 'App',
  components: { NavBar },
  computed: {
    showNavBar() {
      const hide = ['/login', '/register', '/']
      return !hide.includes(this.$route.path)
    },
    routerViewKey() {
      // 为EditQuote路由使用特殊的key，强制重新渲染
      if (this.$route.path.startsWith('/edit-quote')) {
        return this.$route.fullPath + '_' + Date.now()
      }
      return this.$route.fullPath
    }
  }
}
</script>

<style>
#app {
  font-family: 'Microsoft YaHei', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  height: 100vh;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #f5f5f5;
}
</style> 